const Router = require("koa-router");
const router = new Router({ prefix: "/label" });
const { authorverify } = require("../middleware/auth.middleware");

const {
  getalllbabel,
  deleteone,
  addlabel,
  editlabel,
} = require("../controller/label.controller");
//分页获取所有标签
router.get("/getalllabel", getalllbabel);

//管理员获取标签（包含搜索）
router.get("/getalllabelman", authorverify, getalllbabel);
//删除标签
router.delete("/deleteone/:id", authorverify, deleteone);
//添加标签
router.post("/addlabel", authorverify, addlabel);
//修改标签内容
router.patch("/editlabel", authorverify, editlabel);
module.exports = router;
